// 导入用户集合
const { Mood } = require('../../../model/mood');
// 引入分页模块
const pagination = require('mongoose-sex-page')

module.exports = async (req, res) => {
  const { pageIndex, pageSize } = req.query
  const moods = await pagination(Mood).find().sort({_id: -1}).page(pageIndex).size(pageSize).exec()
  res.json({
      data: moods
  })
}